package handler.v1;

public abstract class LeaveHandler {

    protected static final int MIN = 1;

    protected static final int MIDDLE = 3;

    protected LeaveHandler nextHandler;

    protected final void handler(Leave leave){
        execute(leave);
        if(nextHandler != null){
            //递归调用 LeaveHandler 的 handler 方法
            nextHandler.handler(leave);
        }
    }

    protected abstract void execute(Leave leave);

}
